package jbpmguice;

import jbpmguice.instantiation.*;
import org.jbpm.instantiation.Delegation;
import org.jbpm.instantiation.Instantiator;

import java.util.HashMap;
import java.util.Map;

public class GuiceDelegation extends Delegation {

    public static Map<String, Instantiator> getInstantiatorCache() {
        return instantiatorCache;
    }

    static void createInstantiatorCache() {
        instantiatorCache.clear();
        instantiatorCache = new HashMap();
        instantiatorCache.put(null, new GuiceFieldInstantiator());
        instantiatorCache.put("field", new GuiceFieldInstantiator());
        instantiatorCache.put("bean", new GuiceBeanInstantiator());
        instantiatorCache.put("guice", new GuiceConstructorInstantiator());
        instantiatorCache.put("configuration-property", new GuiceConfigurationPropertyInstantiator());
        instantiatorCache.put("xml", new GuiceXmlInstantiator());
    }
}
